﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SPMS.Log.Core
{
    /// <summary>
    /// 抽象日志记录器提供者类
    /// </summary>
    /// <remarks>为日志记录器提供者接口的实现提供了默认抽象基类</remarks>
    /// <history>
    /// [zanezeng]               2009/10/13 14:54    创建
    /// </history>
    public abstract class AbstractLoggerProvider : ILoggerProvider
    {
        #region ---Constructor

        /// <summary>
        /// 初始化类型<see cref="AbstractLoggerProvider"/>的新实例
        /// </summary>
        /// <param name="logger">日志记录器</param>
        /// <remarks></remarks>
        /// <history>
        /// [zanezeng]               2009/10/13 14:57    创建
        /// </history>
        protected AbstractLoggerProvider( ILogger logger )
        {
            //保存参数
            this.m_Logger = logger;
        }

        #endregion

        #region ---ILoggerProvider

        /// <summary>
        /// 获得日志记录器
        /// </summary>
        /// <value>日志记录器</value>
        /// <remarks></remarks>
        /// <history>
        /// [zanezeng]               2009/10/12 14:35    创建
        /// </history>
        /// <remarks></remarks>
        /// <history>
        /// [zanezeng]               2009/10/12 14:43    创建
        /// </history>
        public virtual ILogger Logger
        {
            get
            {
                return this.m_Logger;
            }
        }

        #endregion

        #region ---Field

        /// <summary>
        /// 日志记录器
        /// </summary>
        private readonly ILogger m_Logger;

        #endregion
    }
}
